const {
  app
} = require('electron')
const ProviderWindowController = require('../render/windows/pages/Provider/controller/ProviderWindowController.js')
// const DebuggerWindowController = require('@render/pages/Provider/controller/DebuggerWindowController.js')
// const BrowserWindowController = require('@render/pages/Provider/controller/BrowserWindowController.js')

if (process.env.NODE_ENV !== 'development') {
  global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
}

let mainWindow

function createWindow() {
  /**
   * Initial window options
   */
  mainWindow = new ProviderWindowController(true).window
  mainWindow.on('closed', () => {
    mainWindow = null
  })
}

app.on('ready', createWindow)

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  if (mainWindow === null) {
    createWindow()
  }
})